/****************************************************************

kernel/include/paging.h
Paging header for AWOS

Copyright (c) 2006 Andrew Wilcox. All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:

"This product includes software developed by Andrew Wilcox for
AWOS. (http://code.google.com/p/awos)."

Alternately, this acknowledgment may appear in the software
itself, if and wherever such third-party acknowledgments normally
appear.

4. The names "AWOS" and "Andrew Wilcox" must not be used to
endorse or promote products derived from this software without
prior written permission. For written permission, please contact
Andrew.R.Wilcox@Gmail.com.

5. Products derived from this software may not be called "AWOS"
 nor may "AWOS" appear in their name, without prior written
 permission of Andrew Wilcox.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ANDREW WILCOX BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

****************************************************************/

#ifndef ___AWOS_PAGING_H_
#define ___AWOS_PAGING_H_

#define	PGD_PRESENT	0x001	//present flag
#define	PGD_WRITABLE	0x002	//write flag
#define	PGD_USER	0x004	//user flag
#define	PGD_WRTTHRUCSH	0x008	//page-level write-through caching flag
#define	PGD_NOCACHE	0x010	//page-level cache disable flag
#define	PGD_ACCESSED	0x020	//accessed flag -- the processor sets this flag the first time a page is accessed -- useful for monitoring and OR'ing
#define	PGD_FOURMB	0x080	//page size flag (0 == 4KB, 1 == 4MB)
#define	PGD_GLOBAL	0x100	//global flag (introduced in Pentium Pro -- don't flush from TLB)
#define	PGD_INPOOL	0x200	//in pool flag -- AWOS flag that sets whether or not the memory is in the kernel pool or not
#define	PGD_SWAPIN	0x400	//swap in flag -- AWOS flag specifying whether to swap in or not (basically, is this real memory (set), or is software accessing something it shouldn't (clear)?)
//TODO: figure out whether or not to use 0x800 (available to system programmers)

#define PGE_PRESENT	PGD_PRESENT
#define	PGE_WRITABLE	PGD_WRITABLE
#define	PGE_USER	PGD_USER
#define	PGE_WRTTHRUCSH	PGD_WRTTHRUCSH
#define	PGE_NOCACHE	PGD_NOCACHE
#define	PGE_ACCESSED	PGD_ACCESSED
#define	PGE_DIRTY	0x040	//I wanna get DIRRTY!
#define	PGE_PAT		0x080
#define	PGE_GLOBAL	PGD_GLOBAL

#endif //#ifndef ___AWOS_PAGING_H_
